from core.support import set_cutscene, get_game
from core.basehandler import BaseHandler
from core.room import Room
#from items.oilcan import OilCan
#from items.lamp import Lamp
from core.action import Action
from items.neil import Neil
from items.mary import Mary

class GradLounge(Room):
    def __init__(self, room_id):
        Room.__init__(self, room_id)    # do basic initialization for every room
        
        # add inventory items
        # self.add_item(Lamp())
        # self.add_item(OilCan())
        
        # build list of actions
        self.locked = True
        self.add_action(GoDeanOffice)
        self.add_action(GoCouncilRoom)
        self.add_action(GoBallroom)
        #self.add_item(Neil())
        self.add_item(Mary())
    
    # return description of room.
    def get_description(self):
        game = get_game()
        if self.locked:
            if ('BUid' in game.get_player().inventory):
                desc = "Swipe your ID to enter the Grad Lounge."
            else:
                desc = "You need your BU ID to enter the Grad Lounge. Find your ID."
        else:
            desc = "You are in the Grad Lounge."
        return desc
    
    # return image of room
    def get_image(self):
        return 'entrance_hall.jpg'


class GradLoungeHandler(BaseHandler):
    
    # return class to use to create a new instance of this room
    def get_room_class(self):
        return GradLounge

# define actions for this room

class GoDeanOffice(Action):
    def __init__(self):
        Action.__init__(self, "GoDeanOffice")    # do basic initialization for every action
    
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Go to Dean Freeman's Office"
    
    # return id of room to enter when action is complete
    def get_destination(self):
        return 'deanoffice'
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "get"


class GoCouncilRoom(Action):
    def __init__(self):
        Action.__init__(self, "GoCouncilRoom")    # do basic initialization for every action
    
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Go to the Council Room"
    
    # return id of room to enter when action is complete
    def get_destination(self):
        return 'councilroom'
            
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "get"
    
class GoBallroom(Action):
    def __init__(self):
        Action.__init__(self, "GoBallroom")    # do basic initialization for every action
    
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Go to the Ballroom"
    
    # return id of room to enter when action is complete
    def get_destination(self):
        return 'ballroom'
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "get"